<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="送货单打印" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			document.getElementById("noPrinSpan").style.display="none";
			printContent("管理易-送货单","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			document.getElementById("noPrinSpan").style.display="";
		}
	}
	function doCancel(){
		window.close();
	}
	function showTotalDiv(cost,divId){
		var str="";
		str=str+"本次送货：(金额大写)</b>";
		str=str+getBigMoney(""+cost);
		str=str+"<b>￥</b>"+cost+"&nbsp;";
		document.getElementById(divId).innerHTML=str;
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<c:forEach var="record" items="${list}" varStatus="bi">
<c:if test="${bi.index>0}"><div class='PageNext'>&nbsp;</div></c:if>
<table width="100%" border="0"  align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td width="16%"><img src="${enterpriseInfo.loginImage}" /></td>
					<td width="68%" height="40px" align="center" class="FontLarge_Bold">${licenseInfo.enterpriseName} 送货单</td>
					<td width="16%">&nbsp;</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" width="70%">订货单位：${record[2]}<c:if test="${record[3]=='Y'}"> ${record[4]} ${record[5]}</c:if></td>
			      	<td class="FontSmall" width="30%" align="right">送货日期：<fmt:formatDate value="${record[6]}" pattern="yyyy-MM-dd"/></td>
				</tr>
				<tr class="ListTrPrint">
				  	<td class="FontSmall" colspan="2">地址：<c:if test="${record[3]=='Y'}">${record[7]}</c:if></td>
			    </tr>
		  	</table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
				  <td width="9%" height="23" class="FontSmall_Bold"><div align="center">项目类型</div></td>
				  <td width="15%" class="FontSmall_Bold"><div align="center">内容</div></td>
				  <td width="12%" class="FontSmall_Bold"><div align="center">材质</div></td>
				  <td width="18%" class="FontSmall_Bold"><div align="center">规格</div></td>
				  <td width="7%" class="FontSmall_Bold"><div align="center">单位</div></td>
				  <td width="10%" class="FontSmall_Bold"><div align="center">本次送货</div></td>
				  <td width="7%" class="FontSmall_Bold"><div align="center">单价</div></td>
				  <td width="8%" class="FontSmall_Bold"><div align="center">金额</div></td>
				  <td width="14%" class="FontSmall_Bold"><div align="center">业务单号</div></td>
				</tr>
				<c:forEach var="item" items="${record[0]}" varStatus="i">
				<tr class="ListTrPrint">
				  <td class="FontSmall"><div align="center">${item[4]}</div></td>
				  <td class="FontSmall"><div align="center">${item[6]}</div></td>
				  <td class="FontSmall"><div align="center">${item[5]}</div></td>
				  <td class="FontSmall">
					  <div align="center">
					  ${item[7]}
					  <c:if test="${item[15]=='AREA' || item[15]=='LENGTH'}"> x <commonTag:parseBigDecimal source="${item[9]}" /></c:if>
					  </div>
				  </td>
				  <td class="FontSmall"><div align="center">${item[13]}</div></td>
				  <td class="FontSmall"><div align="center"><commonTag:parseBigDecimal source="${item[11]}" /></div></td>		
				  <td class="FontSmall"><div align="center"><commonTag:parseBigDecimal source="${item[10]}" /></div></td>
				  <td class="FontSmall"><div align="center"><commonTag:parseBigDecimal source="${item[12]}" /></div></td>
				  <td class="FontSmall"><div align="center">${item[16]}</div></td>
				</tr>
				</c:forEach>
				<tr class="ListTrPrint">
					<td class="FontSmall" colspan="9">
						<div align="right" id="totalDiv${bi.index}">&nbsp;/div>
					</td>			  	
				</tr>	
			</table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center" class="ListTable">
				<tr class="ListTrPrint">
					<td class="FontSmall" width="33%">开单人：${record[8]}</td>
					<td class="FontSmall" width="33%">送货人签名：</td>
					<td class="FontSmall" width="34%">客户签名：</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>	
	<c:if test="${codeRule.printFoot!=null && codeRule.printFoot!=''}">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td class="FontSmall"><commonTag:parseEnterToBr source="${codeRule.printFoot}" /></td>
				</tr>
			</table>
		</td>
	</tr>
	</c:if>
</table>
<script language="javascript">
	showTotalDiv(${record[1]},'totalDiv${bi.index}');
</script>
</c:forEach>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="noPrinSpan">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value=" 开始打印" onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>
